package com.sap.apitest2.entity;

import java.util.Collection;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name = "Subcase")
@Entity
@Table(name="t_subcase")
public class Subcase extends AbstractEntity {

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="subcase_id")
	private Long id;
	
	@Column(name="subcase_name")
	private String name;
	
	@Column(name="case_id")
	private Long caseId;
	

	@Transient
	private Collection<Param> params;
//	
	@Transient
	private Collection<Result> status;
	
	
	@Override
	public Long getKey() {
		return id;
	}
	
	@Override
	public void acceptValue(AbstractEntity input) {
		if(input!=null && input instanceof Subcase){
			Subcase param=(Subcase)input;
			this.setName(param.getName());
			this.setCaseId(param.getCaseId());
		}
	}
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Long getCaseId() {
		return caseId;
	}

	public void setCaseId(Long caseId) {
		this.caseId = caseId;
	}

	public Collection<Result> getStatus() {
		return status;
	}

	public void setStatus(Collection<Result> status) {
		this.status = status;
	}

	public Collection<Param> getParams() {
		return params;
	}

	public void setParams(Collection<Param> params) {
		this.params = params;
	}
	
	
	
}
